//
//  MainBaseViewController.m
//  projectBase
//
//  Created by zhuangzhh on 14-11-13.
//  Copyright (c) 2014年 zhuangzhh. All rights reserved.
//

#import "MainBaseViewController.h"
#import "PubFunction.h"

#define MarginOfBottom  10

@interface MainBaseViewController ()

@end

@implementation MainBaseViewController

//
-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];

}



- (void)viewDidLoad
{
    [super viewDidLoad];

    [self initUI];
}


-(void)initUI
{
    self.view.backgroundColor = TextBgColor;
    topBarView = [[TopBarView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, TopBarHeight)];
    topBarView.delegate = self;
    [self.view addSubview:topBarView];
    
//    [[UINavigationBar appearance] setBarStyle:UIBarStyleBlack];
    
    //    [ViewManager shareInstance].NavigationController.interactivePopGestureRecognizer.enabled = YES;
    //
    //    [[NSNotificationCenter defaultCenter] addObserver: self
    //                                             selector: @selector(skinAction:)
    //                                                 name: Notify_ChangeSkin
    //                                               object: nil];
}

//-(void)onchangeskin
//{
//    NSString *skin = [[NSUserDefaults standardUserDefaults] objectForKey:@"skin"];
//    if([skin isEqualToString:@"1"])
//    {
//        topView.backgroundColor = PINKCOlORSKIN;
//    }
//    else
//        topView.backgroundColor = REDCOLORSKIN;
//}

//-(void)skinAction:(id)sender
//{
//    [self onchangeskin];
//}
-(void)onchangeskin
{
    [topBarView onchangeskin];
}

-(void)skinAction:(id)sender
{
    [self onchangeskin];
}


-(void)btnAction:(id)sender
{
    [[NSNotificationCenter defaultCenter] postNotificationName:Notify_CloseSildeMenu object:self];
    
}


-(void)setTopTitle:(NSString *)titleStr
{
    [topBarView setTopTitle:titleStr];
}
-(void)setBackBtnImage:(UIImage *)image
{
    [topBarView setBackBtnImage:image];
}
-(void)setBackBtnHide:(BOOL)hide
{
    [topBarView setBackBtnHide:hide];
}
//-(void)setTopBgColor:(UIColor *)color
//{
//    topView.backgroundColor = color;
//}
-(void)setTopBgColor:(UIColor *)backgroundColor
{
    [topBarView setTopBgColor:backgroundColor];
}

-(void)setTopTitleColor:(UIColor *)color
{
    [topBarView setTopTitleColor:color];
}

-(void)setTopLineHide:(BOOL)hide
{
    [topBarView setTopLineHide:hide];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
